<%@ page import="java.util.ArrayList" %>
<%@ page import="com.bean.User" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/4/22
  Time: 15:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    根据名字,年龄,性别查询学生信息以及学生的班级信息
    <from action="#" method="get">
        姓名:<input type="text" name="sname">
        年龄:<input type="number" name="sage">
        性别:<input type="text" name="sgender">
        <input type="submit" value="查询">

    </from>
    <%
        ArrayList<User> list = new ArrayList<>();
        list.add(new User(1,"tom","123"));
        list.add(new User(2,"大波浪","123"));
        list.add(new User(3,"小蛮腰","123"));
        request.setAttribute("list",list);
    %>

    <tale>
        <tr>
            <td>编号</td>
            <td>账号</td>
            <td>密码</td>
        </tr>
<%--        items:遍历的集合
            var:将遍历出来的元素存储到页面域中
--%>
        <c:forEach items="${list}" var="s">
            <tr>
                <td>${s.id}</td>
                <td>${s.username}</td>
                <td>${s.password}</td>
            </tr>
        </c:forEach>
    </tale>
</body>
</html>
